Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 1 - Introduction to QuickDraw GX Graphics / Geometric Shapes


Geometric Operations

QuickDraw GX provides functions that allow you to modify the geometries of geometric shapes, obtain information about their geometries, and combine the geometries of
two shapes.

One such geometric operation allows you to remove unnecessary or redundant geometric points from the shape's geometry--this process is called reducing a geometry.

Figure 1-7 shows a polygon geometry with two unnecessary geometric points:

Figure 1-7 An example of reducing a shape

In addition to unnecessary geometric points, a shape geometry can have a number of other complicating qualities, such as crossed edges or overlapping contours. QuickDraw GX provides a geometric operation that redefines a shape's geometry to eliminate these qualities. This process is called simplifying a shape. Figure 1-8 shows a polygon contour with two edges that cross and the result of simplifying this shape.

Figure 1-8 An example of simplifying a shape

As Figure 1-8 shows, simplifying the polygon geometry splits it into two contours: an upper triangular contour with three geometric points, and a lower triangular contour with three geometric points. Although the simplified geometry contains more geometric points and more contours than the original, it does not contain any crossed edges.

You can find more about reducing and simplifying shape geometries in the chapter "Geometric Operations" in this book. That chapter also describes many functions that allow you to obtain information about geometric shapes and perform geometric arithmetic on them. Figure 1-9 shows some examples of the different types of geometric information that QuickDraw GX calculates for you.

Figure 1-9 Some examples of the geometric information available about a shape

You can find more about geometric information in the "Geometric Operations" chapter of this book.

Another important type of geometric operation is geometric arithmetic. Figure 1-10 shows examples of intersection, union, difference, reverse difference, and exclusion operations, which each return a result calculated by combining the geometries of two shapes in different ways.

Figure 1-10 Some examples of the geometric arithmetic you can perform with shapes

Other geometric operations provided by QuickDraw GX allow you to

These geometric operations are all discussed in the chapter "Geometric Operations" in this book.

The chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects describes a related set of functions you can use to perform geometric modifications to a shape's geometry. These functions allow you to

Depending on the setting of a shape's map-transform shape attribute, these functions either modify the mapping matrix contained in the shape's transform object or recalculate the geometric points contained in the shape's geometry directly.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help